'use client';

import React from 'react';
import {
  Space, Table, Tag, Empty,
  Avatar, List,
} from 'antd';
import { HddOutlined } from '@ant-design/icons';

import Title from '../components/Title/page';

const { Item } = List;
const { Meta } = Item;

const columns = [
  {
    title: 'Name',
    dataIndex: 'name',
    key: 'name',
    render: (text) => <a>{text}</a>,
  },
  {
    title: 'Age',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: 'Address',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: 'Tags',
    key: 'tags',
    dataIndex: 'tags',
    render: (_, { tags }) => (
      <>
        {tags.map((tag) => {
          let color = tag.length > 5 ? 'geekblue' : 'green';
          if (tag === 'loser') {
            color = 'volcano';
          }
          return (
            <Tag color={color} key={tag}>
              {tag.toUpperCase()}
            </Tag>
          );
        })}
      </>
    ),
  },
  {
    title: 'Action',
    key: 'action',
    render: (_, record) => (
      <Space size="middle">
        <a>
          Invite
          {record.name}
        </a>
        <a>Delete</a>
      </Space>
    ),
  },
];
const tdata = [
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    address: 'New York No. 1 Lake Park',
    tags: ['nice', 'developer'],
  },
  {
    key: '2',
    name: 'Jim Green',
    age: 42,
    address: 'London No. 1 Lake Park',
    tags: ['loser'],
  },
  {
    key: '3',
    name: 'Joe Black',
    age: 32,
    address: 'Sydney No. 1 Lake Park',
    tags: ['cool', 'teacher'],
  },
];

const data = [
  {
    title: '运行环境',
  },
];

function App() {
  return (
    <>
      {/* <List
    itemLayout="horizontal"
    dataSource={data}
    bordered={true}
    renderItem={(item, index) => (
      <Item>
        <Meta
          avatar={<HddOutlined style={{fontSize:'32px',color:'red'}} />}
          title={<a href="https://ant.design">{item.title}</a>}
          description="根据资源列表设置你的应用所需要的各类环境"
        />
      </Item>
    )}
  />
  <Table columns={columns} dataSource={tdata} /> */}
      <Title
        title="资源池"
        des="用于管理分配资源"
        hasRight={false}
      />
      <Empty style={{ height: '500px' }} imageStyle={{ marginTop: '200px' }} description="正在开发中..." />
    </>
  );
}
export default App;
